#include "MockMediaPlugin.h"
#include "AbstractMediaSource.h"

MockMediaPlugin::MockMediaPlugin(QObject *parent) :
   IF_MediaEngineInterface(parent),
   m_lastSource(NULL),
   m_audioState(AudioObject::ErrorState),
   m_volume(-1)
{
}

void MockMediaPlugin::setCurrentSource(const AbstractMediaSource * source)
{
   m_lastSource = source;
}

void MockMediaPlugin::play()
{
   m_audioState = AudioObject::PlayingState;
}

void MockMediaPlugin::pause()
{
   m_audioState = AudioObject::PausedState;
}

void MockMediaPlugin::stop()
{
   m_audioState = AudioObject::StoppedState;
}

void MockMediaPlugin::rewind()
{
   emit tick(0);
}

void MockMediaPlugin::setVolume(int vol)
{
   m_volume = vol;
}

int MockMediaPlugin::volume()
{
   return m_volume;
}

void MockMediaPlugin::setTickInterval(qint32 /*tickMs*/)
{
}

AudioObject::State MockMediaPlugin::state()
{
   return m_audioState;
}

void MockMediaPlugin::onUserPositionRequested(qint64 /*positionMs*/)
{
}

void MockMediaPlugin::setMuted(bool /*muted*/)
{
}



void MockMediaPlugin::togglePlayPause()
{
   // TODO added later. Something to be done?
}
